package com.vichat.common.rudp;

public class ParseData {
    public byte[] dataArray;
    public int startPos;

    public ParseData(byte[] bytedata) {
        dataArray = bytedata;
        startPos = 0;
    }

    public ParseData(String strdata) {
        dataArray = strdata.getBytes();
        startPos = 0;
        //try {

        //for (int i = 0; i < dataArray.length; i++) {
        //    Log.d("$$$$$$$$UTF", i + "-" + dataArray[i]);
        //}
            /*
            dataArray = null;
            dataArray = strdata.getBytes("GBK");
            for (int i = 0; i < dataArray.length; i++) {
                Log.d("$$$$$$$$GBK", i + "-" + dataArray[i]);
            }

            dataArray = null;
            dataArray = strdata.getBytes("ISO-8859-1");
            for (int i = 0; i < dataArray.length; i++) {
                Log.d("$$$$$$$$ISO", i + "-" + dataArray[i]);
            }
            */


        //}catch(Exception e){
        //    Log.e("!!ParseData","constr ParseData error"+e.toString());
        //}
    }

    public String toString() {
        StringBuilder res = new StringBuilder();
        for (int i = 0; i < dataArray.length; i++) {
            res.append(i).append(",").append(dataArray[i]).append("|");
        }
        return res.toString();
    }

}
